package com.sky.boot3ai.controller;

import com.sky.boot3ai.Service.IChatService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
@Slf4j
public class ChatController {

    @Resource
    private IChatService chatService;

    @GetMapping(value = "/chat", produces = "text/html;charset=utf-8")
    public Flux<String> chat(String msg) {

        return chatService.chat(msg);
    }

}
